import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { Language } from "../../../../../extend/language/Language";
import { SWrestlePlayerResult } from "../../../../../Message/Public/SWrestlePlayerResult";
import { EntityUtil } from "../../../scene/layer/utils/EntityUtil";
import { CareerConfig } from "../../../resource/CareerConfig";
import { ObjTeamCreate } from "../../common/ObjTeamCreate";
import { Cache } from "../../../cache/Cache";
//class WrestlePlayerResult
    
    export  class WrestlePlayerResult /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            var loc1=new GTextFormat(FontUtil.songtiName, 14, 15788607);
            this._tfServer = ObjCreate.createTextField("", 70, 8, 120, 22, this, GlobalStyle.textFormat6);
            this._tfName = ObjCreate.createTextField("", 70, 25, 120, 22, this, loc1);
            this._tfCareer = ObjCreate.createTextField("", 130, 45, 50, 20, this, GlobalStyle.textFormat2);
            this._tfLevel = ObjCreate.createTextField("", 70, 45, 50, 20, this, GlobalStyle.textFormat2);
            this._tfPower = ObjCreate.createTextField("", 30, 65, 120, 20, this);
            this._tfTotalHurt = ObjCreate.createTextField("", 30, 82, 120, 20, this);
            this._tfTotalCure = ObjCreate.createTextField("", 30, 100, 120, 20, this);
            this._tfScoreReward = ObjCreate.createTextField(Language.getStringByParam(42236, "0"), 22, 125, 150, 22, this, loc1);
            this._tfScoreTotelReward = ObjCreate.createTextField(Language.getStringByParam(42237, "0"), 22, 145, 150, 22, this, loc1);
            return;
        }

        public updateResult(arg1: SWrestlePlayerResult, arg2: Boolean=false): void
        {
            this._tfServer.text = "[" + EntityUtil.getProxyName(arg1.miniPlayer.entityId) + "]";
            this._tfName.text = arg1.miniPlayer.name;
            this._tfCareer.text = CareerConfig.instance.getInfoByCode(arg1.miniPlayer.careerEnable).name;
            this._tfLevel.text = "LV." + arg1.miniPlayer.level.toString();
            ObjTeamCreate.setTextFieldKeyValue(this._tfPower, Language.getString(42238), arg1.miniPlayer.warfare.toString());
            ObjTeamCreate.setTextFieldKeyValue(this._tfTotalHurt, Language.getString(42239), arg1.totalHurt.toString());
            ObjTeamCreate.setTextFieldKeyValue(this._tfTotalCure, Language.getString(42240), arg1.totalCure.toString());
            this._tfScoreReward.text = Language.getStringByParam(42236, arg1.markAdd.toString());
            if (arg1.miniPlayer.name == Cache.instance.role.entityInfo.name) 
            {
                this._tfScoreReward.text = Language.getStringByParam(42236, arg1.markAdd.toString());
            }
            this._tfScoreTotelReward.text = Language.getStringByParam(42237, arg1.mark.toString());
            return;
        }

        /* internal */ /* var */_tfServer: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfName: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfLevel: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfCareer: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfPower: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfTotalHurt: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfTotalCure: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfScoreReward: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfScoreTotelReward: Object /* flash.text.TextField */;
    }
